package tool

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func SuccessResult(c *gin.Context, v interface{})  {
	code := SUCCESS
	c.JSON(http.StatusOK, map[string]interface{}{
		"code" : code,
		"message" : GetErrorMsg(code),
		"data" : v,

	})
}

func ErrorResult(c *gin.Context, v interface{})  {
	code := ERROR
	c.JSON(http.StatusOK, map[string]interface{}{
		"code" : code,
		"message" :v,
	})
}